<!DOCTYPE html>
<html xmlns:v-on="http://www.w3.org/1999/xhtml" lang="">
<head>
    <meta charset="utf-8" />
    <title>v-on:click</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
    {{message}}
    <!--绑定点击事件,注意传参语法-->
    <button v-on:click="fun1('hello')">vue的onclick</button>
    <button v-on:click="fun2('qwertyuiop')">vue的onclick</button>

</div>
</body>
<script>
    //view model
    new Vue({
        el:"#app",
        data:{
            message:"hello vue"
        },
        methods:{
            fun1:function (msg) {
                alert("hello");
                /*this代表当前vue对象*/
                this.message=msg;
            },
            fun2:function (msg) {
                alert("asdfghjkl");
                /*this代表当前vue对象*/
                this.message=msg;
            }
        }
    });
</script>
</html>